<template>
  <div>
    <ul class="todo-main">
      <Item v-for="todo in props.todoList"
            :key="todo.id"
            :todo="todo"
            :changeDone="props.changeDone"
            :delTodo="props.delTodo"
      />
    </ul>
  </div>
</template>

<script lang="ts">
import {defineComponent} from 'vue';

export default defineComponent({
  name: ""
})
</script>

<script lang="ts" setup>
import Item from "./Item.vue";
import {TodosType} from "../modules/TodoList";

// 接收App传递过来的todoList
interface propsType {
  todoList: TodosType

  changeDone(id: string): void

  delTodo(id: string): TodosType
}

const props = defineProps<propsType>()

</script>
<style lang="scss" scoped>
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>